<template>
    <div class="header">
        <div class="Bao">爆爆团</div>
        <div class="box"></div>
        <div class="head">
            <div @click="handleClick(index)" :class="{active: currentIndex == index }" class="btn"
                v-for="(item,index) in tablist" :key="index">
                <div> {{item.text}} </div>
            </div>
        </div>

    </div>
</template>

<script>
export default {
    data() {
        return {
            currentIndex: 0,
            tablist: [
                {
                    text: '正在抢购'
                },
                {
                    text: '上新预告'
                }
            ]
        }
    },
    methods: {
        handleClick(index) {
            this.currentIndex = index;

        },
    }
}
</script>

<style>
.Bao {
    text-align: center;
    font-size: 30px;
    font-weight: bold;
}
.box {
    width: 100%;
    height: 100px;
    background: orange;
    margin-top: 20px;
}

.head {
    display: flex;
    justify-content: space-around;
    text-align: center;
    align-content: center;
    position: fixed;
    width: 100%;
    padding: 10px 0;
    margin-top: 30px;
}

.head .active {
    text-decoration: underline;
}
</style>